#!/usr/bin/env bash

BUILD_DIR=build

clean() {
    rm -rf ${BUILD_DIR}
}

compile() {
    mkdir ${BUILD_DIR}
    cmake -H. -Bbuild -DCMAKE_EXPORT_COMPILE_COMMANDS=1
    ln -sf build/compile_commands.json
    cd ${BUILD_DIR}
    make && make test
}

clean && compile
